<template>
  <div class="app-container home">
    <el-row :gutter="20">
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>已有标准</span>
          </div>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> {{this.standNUm}}
            </p>
          </div>
        </el-card>
      </el-col>

      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>抽取次数</span>
          </div>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> {{this.randomNum}}
            </p>
          </div>
        </el-card>
      </el-col>
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>问题条数</span>
          </div>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> {{this.problemNum}}
            </p>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top:5px;">
      <el-col :xs="24" :sm="24" :md="12" :lg="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>导入次数</span>
          </div>
          <div class="body">
            <p>
              <i class="el-icon-s-promotion"></i> {{this.importNum}}
            </p>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top:5px;">
      <el-table  :data="standardList">
      <el-table-column label="标准号" align="center" prop="a100" />
      <el-table-column label="标准名称" align="center" prop="a298" />
      <el-table-column label="标准类型" align="center" prop="a850" />
      <el-table-column label="分类名" align="center" prop="categoryName" />
      <el-table-column label="电话" align="center" prop="phone" />
      <el-table-column label="发布日期" align="center" prop="a101" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.a101, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="标准状态" align="center" prop="a200" >
        <template slot-scope="scope">
          <span class="statusyx" v-if="scope.row.a200=='现行有效'">{{scope.row.a200}}</span>
          <span class="statusfz" v-if="scope.row.a200=='企业自行废止'">{{scope.row.a200}}</span>
        </template>
      </el-table-column>
      <el-table-column label="法人" align="center" prop="legalperson" />
      <el-table-column label="电子文本" align="center" prop="a893" >
        <template slot-scope="scope">
          <a class="txtDown" v-if="scope.row.a893!=null" :href="scope.row.a893" target="_blank" ><el-tag>电子文本</el-tag></a>
        </template>
      </el-table-column>
      <el-table-column label="是否参与抽取" align="center" prop="isRandom" >
        <template slot-scope="scope">
          <span v-if="scope.row.isRandom=='0'">否</span>
          <span v-if="scope.row.isRandom=='1'">是</span>
        </template>
      </el-table-column>
      <el-table-column label="问题" align="center" prop="problem" />
    </el-table>
    </el-row>
  </div>
</template>

<script>
import { getImport, getStand, getProblem, getRandom } from "@/api/system/statistics";
import { listStandard } from "@/api/system/standard";

export default {
  name: "Index",
  data() {
    return {
      // 版本号
      version: "3.8.6",
      importNum:'',
      standNUm:'',
      problemNum:'',
      randomNum:'',
      // 双随机标准表格数据
      standardList: []
    };
  },
  created() {
    getImport().then(response=>{
      this.importNum = response.data;
    })
    getStand().then(response=>{
       this.standNUm = response.data;
    })
    getProblem().then(response=>{
       this.problemNum = response.data;
    })
    getRandom().then(response=>{
       this.randomNum = response.data;
    })
    listStandard(this.queryParams).then(response => {
      this.standardList = response.rows;
      this.total = response.total;
    });
    
  },
  methods: {
    goTarget(href) {
      window.open(href, "_blank");
    }
  }
};
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}
</style>

